package com.atguigu.wuliupublisher.mapper;


import com.atguigu.wuliupublisher.bean.TrandsReceiveCt;
import com.atguigu.wuliupublisher.bean.TrandsReceiveSucCt;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface TrandsReceiveMapper {
    //派送成功个数省份粒度
    @Select("SELECT province_name,SUM(deliver_suc_count_base) suc_deliver from dws_trans_org_deliver_suc_day_base partition (par#{date}) group by province_name,province_id")
    List<TrandsReceiveSucCt> selectTradeProvinceOrderCt(@Param("date")Integer date);
    //机构揽收数量topN
    @Select("SELECT org_name, SUM(receive_order_count_base) AS receiveCt\n" +
            "FROM dws_trans_org_receive_day_base\n" +
            "partition  (par#{date})\n" +
            "GROUP BY org_name \n    " +
            "ORDER BY receiveCt\n" +
            "LIMIT 5;\n")
    List<TrandsReceiveCt> selectTrandsReceiveCt(@Param("date")Integer date);

}
